#!/usr/bin/make

# Microcontroller properties.
PART=LM4F120H5QR
CPU=-mcpu=cortex-m4
FPU=-mfpu=fpv4-sp-d16 -mfloat-abi=softfp

#  List of the objects files to be compiled/assembled
PORT_OBJECTS = io.o serial.o syscalls.o adc.o pwm.o timers.o i2c.o LM4F_startup.o
PORT_OBJECTS := $(addprefix $(ARCH_COMMON_DIR)/, $(PORT_OBJECTS))

LSCRIPT=$(ARCH_COMMON_DIR)/LM4F.ld

DEBUG ?= -g
OPTIMIZATION ?= 2

#  Compiler Options - Add whatever's needed
CFLAGS := $(CFLAGS) -I./ -I$(ARCH_DIR) -I$(ARCH_COMMON_DIR) $(INCLUDES) -O$(OPTIMIZATION) $(DEBUG) 
CFLAGS+=-mthumb ${CPU} ${FPU} -ffunction-sections -fdata-sections -std=c99
CFLAGS+= -I$(ARCH_COMMON_DIR)/inc -I$(ARCH_COMMON_DIR)/driverlib -DPART_$(PART) -DTARGET_IS_BLIZZARD_RA1
LDFLAGS := $(LDFLAGS) -O$(OPTIMIZATION) -Wl,-Map=$(PROJECT).map,--gc-sections --entry rst_handler -T$(LSCRIPT)

CPPFLAGS = $(CFLAGS)

#  Compiler/Assembler/Linker Paths
CC = arm-none-eabi-gcc
CXX = arm-none-eabi-g++
AS = arm-none-eabi-as
LD = arm-none-eabi-ld
OBJCOPY = arm-none-eabi-objcopy
SIZE = arm-none-eabi-size
REMOVE = rm -f

